-
Notifications
You must be signed in to change notification settings - Fork 177
Adding a new magic command: %degreeDistribution #749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
||
|
||
|
||
# %degreeDistribution. Takes traversalDirection, vertexLabels, edgeLabels parameters, and visualizes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can you add a more comprehensive docstring here to explain its overall purpose and usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like
This magic analyzes and displays the distribution of vertex degrees in the graph,
allowing filtering by vertex and edge types. It provides an interactive visualization
with statistics including maximum degree, median degree, and mean degree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, any estimates on how long this query would take? If its going to be long running, it would be nice to have a progress indicator or something that indicates how much time this could take.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making the OC call only takes a couple seconds for com-Orkut, which is really large. But visualization takes some time, and I'm working on it. I'll keep the progress bar in mind in case. Thanks for pointing out.
"we will default to using all the edge labels.") | ||
|
||
|
||
# TODO: Additional parameter for saving the visualization? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any estimates on how much effort this would require to implement as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's trivial but not sure if needed, will confirm with Dave/Ozan.
@needs_local_scope | ||
@display_exceptions | ||
@neptune_graph_only | ||
def degreeDistribution(self, line, local_ns: dict = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what i understand this would only work for Neptune Analytics, right? Please add error handling for when this magic is used with Neptune. Refer to the load magic for reference.
Reference Link: https://github.com/aws/graph-notebook/blob/main/src/graph_notebook/magics/graph_magic.py#L2056-L2061
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added but please check; I did not use try/catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congratulations on your first contribution, @sariyuce! :)
Nice work on implementing the degree distribution visualization! This is a great addition implementing the degree distribution visualization functionality for Neptune Analytics.
The implementation is well-structured and the interactive widget approach will be very useful for users exploring graph degree distributions. Really nice work!
I've added a few suggestions to enhance the code further.
Additionally, Since there are multiple commits in this PR, please remember to squash them when merging to keep our commit history clean. Also ensure you modify the commit message.
Let me know if you need any clarification on the suggestions!
Looking forward to more contributions from you. 🚀
Thanks for the comments! I addressed the comments but will have some more changes before the next push. Will squash all. |
Description of changes:
%degreeDistribution visualizes the degree distribution of the graph. It'll make use of a newly implemented
degreeDistribution
algorithm in NA (not GA yet).By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.